<?php
//use Illuminate\Support\Facades\Redis;
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
//    Redis::setex('site_name', 60, 'Lumen的redis');
//    return Redis::get('site_name');exit;
    return $router->app->version();
});
//登录注册
$router->get('user/login', 'UserController@login');
$router->get('user/register', 'UserController@register');
$router->get('user/client', 'UserController@client');
$router->get('user/server', 'UserController@server');
//$router->get('user/info', ['middleware' => 'authToken', 'uses' => 'UserController@info']);

$router->group(['middleware' => 'authToken'], function($router)
{
    $router->get('user/info', 'UserController@info');
});

